Skip to content

fix: resolve branch name display issues#36

Closed
mishraprafful wants to merge 1 commit intomainfrom
fix/branch-name-display
Closed

fix: resolve branch name display issues#36
mishraprafful wants to merge 1 commit intomainfrom
fix/branch-name-display

Conversation

@mishraprafful
Copy link
Copy Markdown
Collaborator

@mishraprafful mishraprafful commented Apr 2, 2026

Fixes #31

Root cause

The session header was showing worktreePath (the full absolute path, e.g. /Users/foo/modal-sandbox--docs-modal-sandbox) alongside session.branchName (docs/modal-sandbox). Since the sanitized branch name is embedded in the worktree path, the branch info appeared twice.

Sessions without a worktree branch (session.branchName = null) showed nothing for the branch, so main was never displayed.

The branch was also static — set at session creation — so checking out a different branch externally never updated the header.

Fixes

  • Bug 1 (shown twice): Show only the folder name (last path segment of worktreePath) instead of the full path
  • Bug 2 (main not shown): Fetch the live branch via getRepoBranch on mount — now shown for all sessions including those on main
  • Bug 3 (stale branch): Poll getRepoBranch every 3 seconds so the displayed branch stays in sync when the user checks out a different branch externally

Screenshots

Screenshot 2026-04-02 at 13 55 29 Screenshot 2026-04-02 at 13 55 47

🤖 Generated with Claude Code

- Show folder name (last path segment) instead of full worktree path,
  preventing the branch name from appearing twice when the path embeds it
- Fetch the live git branch from the worktree/repo path every 3s so the
  displayed branch stays current when the user checks out a different branch
- Always show the current branch (including main) since it is now fetched
  dynamically rather than relying on the static session.branchName field

Fixes #31

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@mishraprafful mishraprafful marked this pull request as draft April 2, 2026 11:52
@mishraprafful mishraprafful self-assigned this Apr 2, 2026
@mishraprafful mishraprafful requested a review from dakl April 2, 2026 11:56
@mishraprafful mishraprafful marked this pull request as ready for review April 2, 2026 12:19
Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@mishraprafful mishraprafful changed the title fix: resolve branch name display issues (#31) fix: resolve branch name display issues Apr 2, 2026
@mishraprafful mishraprafful marked this pull request as draft April 2, 2026 12:46
@mishraprafful mishraprafful marked this pull request as draft April 2, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: branch name inconsistency

1 participant